# import os
#
# import yaml
#
#
# def load_test_data(file_path='../data/test_data.yaml'):
#     with open(file_path,'r',encoding='utf-8') as file:
#         data=yaml.safe_load(file)
#         print(data)
#
#     return [(case['book'],) for case in data['test_cases']]
#
# def get_project_path():
#     #返回项目路径
#     return os.path.abspath(os.path.join(os.path.dirname(__file__),".."))
#
# def build_path(*path,add_sep_before=False):
#     #拼接项目里的路径
#     all_path=os.sep.join(path)
#     if add_sep_before:
#         all_path=os.sep+all_path
#     return all_path
#
#
# if __name__ == '__main__':
#     # print(load_test_data())
#     print(get_project_path())
#     print(get_project_path()+build_path('common','tools',add_sep_before=True))

import os

import yaml


def load_test_data(file_path='../data/test_data.yaml'):
    with open(file_path, 'r', encoding='utf-8') as file:
        data = yaml.safe_load(file)
        print(data)

    return [(case['book'],) for case in data['test_cases']]


def get_project_path():
    # 返回项目路径
    return os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))


def build_path(*path, add_sep_before=False):
    # 拼接项目里的路径
    all_path = os.sep.join(path)
    if add_sep_before:
        all_path = os.sep + all_path
    return all_path


if __name__ == '__main__':
    # print(load_test_data())
    print(get_project_path())
    print(get_project_path() + build_path('common', 'tools', add_sep_before=True))